<html><head>
<title>还款流水记录</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<include file="./Public/public/public.html" />
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/user-center.css">
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/flow.css">
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/bootstrap.css">
<body>
<div class="layout-wrap">
    <div class="container_page padding-sm-none">
							<section>
								<h2>{$error}</h2>
								<div class="tab_table page_min_h">
									<div class="table-responsive">
										<table class=" table table-bordered table-striped table-hover " style="font-size: 13px;">
											<thead>
											<tr>
												<th>借款流水</th>
												<th>还款日期</th>
												<th>借款人</th>
												<th>期数</th>
												<th>还款金额</th>
												<th>状态</th>
												<th>操作</th>
											</tr>
											</thead>
											<tbody class="text-center">
											<volist name="list" id="vo">
											<tr>
												<td>{$vo.cred_flowid}</td>
												<td>{$vo.repaydate}</td>
												<td>{$username}</td>
												<td>{$vo.stage}</td>
												<td>
													<if condition="$vo['stage'] eq $credflow['persionnum']">
														{$credflow['interest']+$credflow['money']+$credflow['penalty']+$credflow['mangrate']}&nbsp;元<br/>&nbsp;(含&nbsp;{$credflow['mangrate']}元&nbsp;管理费)
													<else/>
														{$credflow['interest']+$credflow['penalty']}&nbsp;元
													</if>
												</td>
												 <td> 
													 <span class="font_default">
													 <if condition="$vo.is_yq eq 1">
													 	还款中
													 </if>
													 <if condition="$vo.is_yq eq 2">
													 	已逾期
													 </if>
													 <if condition="$vo.is_yq eq 3">
													 	已还款
													 </if>
													 </span>						
												</td>
												<if condition='$ty neq 2'>
												 <td id="idd{$vo.id}">
												 	<if condition="$vo.is_yq eq 1">
													 	<input type="button" data-id="{$vo.id}" class="optbutcl torepaymentopne" value="还 款">
													 </if>
													 <if condition="$vo.is_yq eq 2">
													 	<input type="button" data-id="{$vo.id}" class="optbutcl torepaymentopne" value="还 款">
													 </if>
													 <if condition="$vo.is_yq eq 3">
													 	已还款
													 </if>
												 </td>
												<else />
													<td id="idd{$vo.id}">
													<if condition="$vo.is_yq eq 1">
													 	还款中
													 </if>
													 <if condition="$vo.is_yq eq 2">
													 	已逾期
													 </if>
													 <if condition="$vo.is_yq eq 3">
													 	已还款
													 </if>
													 </td>
												</if>
											 </tr>		
											 </volist>									
									</tbody>
										</table>
									</div>
								</div>
							</section>
						</div>
    </div>
    
    <div popup="errorSaveDomain" class="reveal-modal medium">
    <a class="close-reveal-modal" action="closeModal">×</a>
    <h3 id="popupTitle">请输入您的支付密码</h3>
    <div><br/>
    <div class="form-row form-row-s" id="errorDomainList">
    	<form action="{:U('Repaycredit/torepayment')}" method='post' id="repayformid">
    	<input type="hidden" name="id" value='' id="repayid"/>
     	 <input name="authpaswd" type="password" class="input-s" placeholder="请输入支付密码" id="authpaswdid" value=''/>
     	</form>
    </div>
    <div class="split-dot mb20 mt20 text-center">
    </div>
    <div class="form-row">
        <a action="confirm" class=" button button-orange w40 fl">确定还款</a>
        <a action="cancel" class=" button button-gray w40 fr">取消</a>
        <div class="clr"></div>
    </div>
</div></div>

<style>
    .optbutcl{
	min-width: 16px;color: #ffffff;
    background-color: #f0ad4e;
    border-color: #eea236;    -webkit-appearance: button;
    cursor: pointer;display: inline-block;
    margin-bottom: 0;
    font-weight: normal;
    text-align: center;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    white-space: nowrap;
    padding: 8px 8px;
    font-size: 15px;
    line-height: 1.42857143;
    border-radius: 2px;
    -webkit-user-select: none;
    }
    </style>
    <script type="text/javascript">
    $(".torepaymentopne").click(function(){
    	$("#repayid").val($(this).attr("data-id"));
    	$('[popup="errorSaveDomain"]').reveal();
    });
    $("a[action='confirm']").click(function () {
    	if($("#authpaswdid").val()==''){
    		showModal({ msg:'请输入支付密码'});
    		return false;
    	}
    	$.ajax({
    		url:$("#repayformid").attr("action"),
    		data:$('#repayformid').serialize(),
    		datatype:'json',
    		success:function(resp) {
    			 if (resp.code == 'error') { showModal(resp.info); }
                 else { 
                	 showModal('还款成功'); 
                	 $("#idd"+$("#repayid").val()).text('已还款');
                	 $("[popup='errorSaveDomain']").closeModal();
                 }
    		}
        });
    });
    </script>
</body></html>